#include <iostream>
#include <string>
#include <unistd.h>
#include <stdlib.h>
#include <signal.h>


void Usage(std::string proc)
{
    std::cout << "Usage: " << proc << " signumber processid" << std::endl;
}

// ./mykill 9 1234
int main(int argc,char* argv[])
{
    if(argc != 3)
    {
        Usage(argv[0]);
        exit(1);
    }
    int signumber = std::stoi(argv[1]);
    pid_t id = std::stoi(argv[2]);
    int n = ::kill(id,signumber);
    if(n < 0)
    {
        perror("kill");
        exit(2);
    }
    exit(0);

    return 0;
}
